﻿using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using WebApplication.Controllers;

namespace UnitTestProject
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void ClassJwtHelp()
        {
            string usname = "stddf";
            DateTime etime = new DateTime(2008, 5, 12, 14, 28, 0);
            var payload = new Dictionary<string, object>
            {
                { "UserName",usname },
                { "Expired", etime }
            };
            string token = JwtHelp.SetJwtEncode(payload);
            UserInfo u = JwtHelp.GetJwtDecode(token);
            Assert.AreEqual(u.UserName, usname);
            Assert.AreEqual(u.Expired, etime);
        }
    }
}
